Skip to content

Improve strategy plugin consumption notifications#107

Merged
Pigbibi merged 2 commits into
mainfrom
codex/plugin-consumption-small-account-execution
Jun 23, 2026
Merged

Improve strategy plugin consumption notifications#107
Pigbibi merged 2 commits into
mainfrom
codex/plugin-consumption-small-account-execution

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add separate plugin consumption notification lines for auto-consumed, review-only, not-applied, and load-failure cases
  • keep the main plugin status line focused on enabled/status/action
  • add zh/en i18n keys and coverage for consumption rendering

Validation

  • PYTHONPATH=/home/ubuntu/Projects/QuantPlatformKit/src timeout 120 python -m unittest tests.test_strategy_plugins
  • git diff --name-only -- '*.py' | xargs -r python -m py_compile
  • i18n zh/en key, placeholder, and English CJK scans

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6c9ac5769

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

localized = _optional_string(notification_messages.get(default_locale))
if localized:
return localized
if localized:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard the notification fallback before using localized

When a signal includes a notification object that does not contain a localized_messages mapping, this branch reaches if localized without ever assigning localized, so extract_strategy_plugin_localized_message(..., section="notification", locale=...) and therefore build_strategy_plugin_notification_lines(..., locale=...) raise UnboundLocalError instead of falling back to the generic plugin line. This affects artifacts that carry notification metadata but no localized notification copy.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dbefff174d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1017 to +1020
if translator is not None:
consumption_line = _strategy_plugin_consumption_notification_line(signal, translator=translator)
if consumption_line:
lines.append(consumption_line)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Append consumption lines for locale-only notifications

When a signal carries localized_messages.notification and the caller uses the documented locale-only path (build_strategy_plugin_notification_lines(signals, locale="zh-CN") in docs/strategy_plugin_runtime_contract.md), translator is None, so this guard suppresses the new consumption line entirely. Auto-consumed, review-only, or not-applied localized artifacts then return only the artifact text while non-localized artifacts still get the consumption status later in the function, leaving users without the key position-consumption disclosure.

Useful? React with 👍 / 👎.

@Pigbibi Pigbibi merged commit 486c025 into main Jun 23, 2026
1 check passed
@Pigbibi Pigbibi deleted the codex/plugin-consumption-small-account-execution branch June 23, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant